package cn.iver.controller;

import cn.iver.component.AdminInterceptor;
import cn.iver.component.GlobalInterceptor;
import cn.iver.model.Blog;
import cn.ratel.aop.annotation.Clear;
import cn.ratel.aop.annotation.Enhancer;
import cn.ratel.db.Cache;
import cn.ratel.db.Page;
import cn.ratel.ioc.annotation.Controller;
import cn.ratel.ioc.annotation.Inject;

import java.util.List;

@Controller
@Enhancer(AdminInterceptor.class)
public class IndexController {
	@Inject
	private Blog dao;

	@Clear(GlobalInterceptor.class)
	public List<Blog> list() {
		return dao.hot();
	}

	public Blog one(int id) {
		return dao.one(id);
	}

	public Page<Blog> page(int p, int type) {
		return dao.page(p, type);
	}
}